<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
<head>
<title>Market place</title>
</head>
<f:view>
	<body>
		<ui:composition>
			<p:dialog header="Edit price info" widgetVar="editProductInfoDlg"
				resizable="false" id="editProductInfoDialog" showEffect="explode"
				hideEffect="clip" modal="false" style="font-size:1.0em"
				rendered="#{weeklyModel.currentProductPrice!=null}">
				<p:commandButton value="OK and Save to Information immediately"
						ajax="true" update=":detailForm,:headerForm" actionListener="#{weeklyController.storeToProductInfo}"
						oncomplete="editProductInfoDlg.hide()" style="float:right" />
				<p:panelGrid>
					
					<p:row>
						<p:column colspan="2">
							<h:outputText value="Number:"></h:outputText>
						</p:column>
						<p:column>
							<h:panelGroup>
								<h:graphicImage library="images"
									value="../#{weeklyModel.currentProductPrice.product.icon}32.png"></h:graphicImage>
								<h:outputText
									value="#{weeklyModel.currentProductPrice.product.number}"></h:outputText>
							</h:panelGroup>
						</p:column>
					</p:row>
					<p:row>
						<p:column colspan="2">
							<h:outputText value="Name:"></h:outputText>
						</p:column>
						<p:column>
							<h:outputText
								value="#{weeklyModel.currentProductPrice.product.name}"></h:outputText>
						</p:column>
					</p:row>
					<p:row>
						<p:column colspan="2">
							<h:outputText value="Specification:"></h:outputText>
						</p:column>
						<p:column>
							<h:outputText
								value="#{weeklyModel.currentProductPrice.product.specificationDescLabel}"></h:outputText>
						</p:column>
					</p:row>
					<p:row>
						<p:column rowspan="2">
							<h:outputText value="Price"></h:outputText>
						</p:column>
						<p:column>
							<h:outputText value="Regular" />
						</p:column>

						<p:column>
							<h:inputText value="#{weeklyModel.currentProductPrice.price}"
								style="text-align:right" />
						</p:column>
					</p:row>
					<p:row>
						<p:column>
							<h:outputText value="Special" />
						</p:column>
						<p:column>
							<h:inputText
								value="#{weeklyModel.currentProductPrice.specialPrice}"
								style="text-align:right" />
						</p:column>
					</p:row>
					<p:row>
						<p:column rowspan="3">
							<h:outputText value="Unit price"></h:outputText>
						</p:column>
						<p:column>
							<h:outputText value="English" />
						</p:column>

						<p:column>
							<h:inputText value="#{weeklyModel.currentProductPrice.unitPrice}"
								style="text-align:right" />
						</p:column>
					</p:row>
					<p:row>
						<p:column>
							<h:outputText value="Chinese" />
						</p:column>
						<p:column>
							<h:inputText
								value="#{weeklyModel.currentProductPrice.chineseUnitPrice}"
								style="text-align:right" />
						</p:column>
					</p:row>
					<p:row>
						<p:column>
							<h:outputText value="French" />
						</p:column>
						<p:column>
							<h:inputText
								value="#{weeklyModel.currentProductPrice.frenchUnitPrice}"
								style="text-align:right" />
						</p:column>
					</p:row>
					<p:row>
						<p:column colspan="2">
							<h:outputText value="Inventory" />
						</p:column>
						<p:column>
							<h:inputText
								value="#{weeklyModel.currentProductPrice.product.inventory}"
								style="text-align:right" />
						</p:column>
					</p:row>
				</p:panelGrid>

				<h:panelGrid columns="2" style="width:100%">
					<p:commandButton value="Cancel" type="button"
						onclick="editProductInfoDlg.hide()" style="float:left" />
					<p:commandButton value="OK" ajax="true"
						update=":detailForm,:headerForm"
						oncomplete="editProductInfoDlg.hide()" style="float:right" />
				</h:panelGrid>


			</p:dialog>
		</ui:composition>
	</body>
</f:view>
</html>